package com.woniu.liuzhougov.authorityControl.controller;

import com.woniu.liuzhougov.message.utils.MessageUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @author wyz02
 * @version 1.0
 * @ClassName MessageCodeController
 * @Description: 发送短信验证码
 * @date 2019/4/30 14:33
 */
@Controller
@RequestMapping("user/message")
public class MessageCodeController {

    @RequestMapping("/get")
    @ResponseBody
    public String getCode(String phone, HttpSession session){
        String verifyCodeExpected = (String)session.getAttribute("registerCode");
        //发送验证码
        //phone:电话，code：验证码
        MessageUtil.sendIdentifyingCode(phone,verifyCodeExpected);

        return "success";
    }
}
